import { axios } from '@/utils/request'

/**
 * 查询OA流程表单列表
 * @param query
 * @returns {*}
 */
export function pageForm(query) {
  return axios({
    url: '/workflow/form/page',
    method: 'get',
    params: query
  })
}

/**
 * 查询OA流程表单详细
 * @param formId
 * @returns {*}
 */
export function getForm(formId) {
  return axios({
    url: '/workflow/form/' + formId,
    method: 'get'
  })
}

/**
 * 新增OA流程表单
 * @param data
 * @returns {*}
 */
export function addForm(data) {
  return axios({
    url: '/workflow/form',
    method: 'post',
    data: data
  })
}

/**
 * 修改OA流程表单
 * @param data
 * @returns {*}
 */
export function updateForm(data) {
  return axios({
    url: '/workflow/form',
    method: 'put',
    data: data
  })
}

/**
 * 挂载OA表单到具体流程
 * @param data
 * @returns {*}
 */
export function addDeployForm(data) {
  return axios({
    url: '/workflow/form/addDeployForm',
    method: 'post',
    data: data
  })
}

/**
 * 删除OA流程表单
 * @param formId
 * @returns {*}
 */
export function delForm(formId) {
  return axios({
    url: '/workflow/form/' + formId,
    method: 'delete'
  })
}
